home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 April / EnigmA AMIGA RUN 26 (1998)(G.R. Edizioni)(IT)[!][issue 1998-04].iso / classx / util / xfa_util / arexx / adpro_animtoxfa.rexx < prev    next >
OS/2 REXX Batch file  |  1998-03-09  |  4KB  |  90 lines

  1. /*
  2. ** Anim To XFA REQUESTER - ADPro Arexx Script Converter
  3. **
  4. ** This code shows how to open a File Requester
  5. ** For setting Input Anim Name and Output Anim Name.
  6. **
  7. ** This code (C)Copyright Fabio Rotondo.
  8. ** It is given as Freeware example and may not be used
  9. ** for any commercial product.
  10. **
  11. */
  12.  
  13. ADDRESS "XFA.1"                 /* Let's ADDRESS XFA */
  14. CountFormat ""
  15. SetPath ADPro "ADPro:ADPro"     /* Set ADPro Path    */
  16. CallProcessor ADPro             /* Call ADPro        */
  17.  
  18. ADDRESS "ADPro"       /* Let's ADDRESS ADPro          */
  19. LFORMAT "ANIM"        /* InputFile is an ANIM File    */
  20. SFORMAT "IFF"         /* We have to save it as an IFF */
  21. INTERFACE_SIZE TINY
  22. OPTIONS RESULTS
  23.  
  24. sparename = "T:Frame" /* Name of file to be processed */
  25.  
  26. /* Here we ask for an Anim File name for input */
  27. GETFILE '"Select An Anim File To Convert"'
  28. IF RC = 10 THEN abort()  /* If user press cancel, we abort the script */
  29. animname = ADPRO_RESULT  /* We store ANIM file name into animname     */
  30.  
  31. /* Here we ask for a Output XFA Anim File Name for output */
  32. GETFILE '"Save XFA Anim as..."'
  33. IF RC = 10 THEN abort()  /* Same as Above...*/
  34. outname = ADPRO_RESULT
  35.  
  36. frames = 0                            /* Number of frames of the Anim */
  37. LOAD animname COUNT                   /* Let's count the Anim Frames */
  38. frames = ADPRO_RESULT-2               /* frames = ADPro's Result     */
  39.  
  40. LOAD animname FRAME 1                 /* Now we load the 1st Frame    */
  41. EXECUTE                               /* We render it into ADPro      */
  42. PSTATUS LOCKED                        /* And Lock The Palette next    */
  43.                                       /* Frames will be remapped is   */
  44.                                       /* We need it. (Multi pal anims)*/
  45.  
  46. SAVE sparename||0 IMAGE               /* Save it into T:Frame0        */
  47.  
  48.  
  49. ADDRESS "XFA.1"          /* Now we call XFA (port is XFA.1)    */
  50. FirstFrame 0             /* We Set FirstFrame to 0             */
  51. LastFrame frames         /* We Set LastFrame to Anim Frames    */
  52. Compression 32I          /* Set Compression to  32I            */
  53. CloseAnim LOOP           /* Set AnimClose Mode to  LOOP        */
  54. InputName sparename      /* Input Root Name is T:Frame         */
  55. OutputName outname       /* XFA Animation Name will be T:a.xfa */
  56. SetProcessor ADPro       /* We Select ImageProcessor Program   */
  57. InitXFA                  /* XFA Initialization                 */
  58.                          /* NOTE: BEFORE call InitXFA you have */
  59.                          /* To perform AT LEAST all settings   */
  60.                          /* We have done inside this example.  */
  61.                          /* Also remember of having the FIRST  */
  62.                          /* Frame of the ANIM saved as IFF, for*/
  63.                          /* Configuring correctly XFA          */
  64.  
  65. DO t=1 TO frames                        /* For t=1 TO NFrames... */
  66.     ADDRESS "ADPro"                     /* Call ADPro            */
  67.     LOAD animname FRAME t               /* Load Frame N          */
  68.     EXECUTE                             /* Render It             */
  69.     x = t-1
  70.     n = sparename||x
  71.     SAVE n  IMAGE                       /* Save Picture          */
  72.  
  73.     ADDRESS "XFA.1"                     /* Call XFA              */
  74.     GetFrame (t-1)                      /* Load This Frame       */
  75.     PutFrame                            /* Put It Inside Anim    */
  76. END                                     /* Next                  */
  77.  
  78. CloseXFA                                /* Here We Close XFA Anim*/
  79. Message '"Conversion done."'
  80.  
  81. ADDRESS "ADPro"
  82. PSTATUS UNLOCKED
  83.  
  84. exit                                    /* End Of Arexx Script!! */
  85.  
  86. abort:
  87.     ADDRESS "XFA.1"
  88.     Message '"Operation Aborted By The User."'
  89.     exit(0)
  90.